// initialize
Initialize the line to " no customers"
currentTime = 0
while (events remain to be process)
{
    currentTime = time of next event
    if (event is an arrival event)
        process arrival event
    else
        process departure event

//  an arrival event and an departure event occur at the same time
//  arbitrarily process the arrival event
}
